﻿var insertMode = true;

$(function () {
    Custom.init();
});

function beginSubmit(content) {
    $("#ErrorMessage").html("");
    if (validateForm()) {
        $("#Save").attr("disabled", true);
        return true;
    }
    return false;
    return true;
}

function submitCompleted(content) {
    var response;

    response = content.get_object().Data;

    if (response) {
        closePopupAndRefresh(insertMode);
    }
    else {
        $("#Save").removeAttr("disabled");
        alert("error");
    }
}

function validateForm() {
    if (DoValidations(true)) {
        return true;
    }
    return false;
}

function subtmitError(content) {
    alert(content);
}